package cn.edu.neusoft.service;


import cn.edu.neusoft.config.OauthConfigUtil;
import com.dahuatech.icc.exception.ClientException;
import com.dahuatech.icc.oauth.http.IccTokenResponse;
import com.dahuatech.icc.oauth.utils.HttpUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

/**
 * program:java-sdk-demo
 *
 * @Author: 355079
 * @Date:2024-03-07 13:57
 * @Description: 鉴权
 */
@Service
public class OauthHandler {
    @Autowired
    private OauthConfigUtil OauthHandler;
    public OauthHandler() {
        System.out.println("OauthHandler");
    }

    public IccTokenResponse.IccToken getTokenInfo() throws ClientException {
        return HttpUtils.getToken(OauthHandler.getOauthConfig());
    }
}
